package com.engr.lyx.blog.biz.service;

import com.engr.lyx.blog.client.dto.ArticleDTO;
import com.engr.lyx.blog.client.entity.Article;
import com.engr.lyx.blog.client.vo.ArticleArchiveVO;
import com.engr.lyx.blog.client.vo.ArticleVO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @program: blog
 * @desc:
 * @author: lyx
 * @date: 2019-05-09 20:15
 **/
public interface ArticleService {

    /**
     * 根据id查找
     *
     * @return
     */
    Article selectById(ArticleDTO articleDto);

    /**
     * 根据用户id查找
     *
     * @param userId
     * @param pageable
     * @return
     */
    Object selectByUserId(Long userId, Pageable pageable);

    /**
     * @desc 查询用户点击量最高的文章
     * @author lyx
     * @create 2019-05-18
     **/
    List<ArticleVO> selectTopArticleVisit(Long userId);

    /**
     * 根据标签id查找
     *
     * @param tagId 标签id
     * @return
     */
    Page<Article> selectArticlesByTagId(Integer tagId, Long userId, Pageable pageable);

    /**
     * 查找用户最热门文章 order by tag2
     *
     * @param userId 用户id
     * @return
     */
    List<Article> selectAllByOrderByTags2Desc(Long userId);

    /**
     * 根据id查找上下两篇文章
     *
     * @param id id
     * @return
     */
    List<Article> selectArticleByIdNear(long id, long userId);

    /**
     * 查找归档
     *
     * @author LiuYanxin
     * @date 2020-11-05 05:45:59
     **/

    List<ArticleArchiveVO> selectByArchive();


}
